home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / xinfo101.lha / xinfo-1.01.01 / xinfo.c < prev   
C/C++ Source or Header  |  1991-01-09  |  3KB  |  108 lines

  1. #ifndef lint
  2. static char *rcsid = "$Header: /usr1/ben/jkh/tmp/xinfo/RCS/xinfo.c,v 1.4 91/01/07 14:02:59 jkh Exp Locker: jkh $";
  3. #endif
  4.  
  5. /*
  6.  *
  7.  *                   Copyright 1989, 1990
  8.  *                    Jordan K. Hubbard
  9.  *
  10.  *                PCS Computer Systeme, GmbH.
  11.  *                   Munich, West Germany
  12.  *
  13.  *
  14.  * This file is part of GNU Info widget.
  15.  *
  16.  * The GNU Info widget is free software; you can redistribute it and/or
  17.  * modify it under the terms of the GNU General Public License as published
  18.  * by the Free Software Foundation; either version 1, or (at your option)
  19.  * any later version.
  20.  *
  21.  * This software is distributed in the hope that it will be useful,
  22.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  23.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  24.  * GNU General Public License for more details.
  25.  *
  26.  * You should have received a copy of the GNU General Public License
  27.  * along with this software; see the file COPYING.  If not, write to
  28.  * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  29.  *
  30.  *
  31.  */
  32.  
  33. /*
  34.  * $Log:    xinfo.c,v $
  35.  * Revision 1.4  91/01/07  14:02:59  jkh
  36.  * info string now correct for non-gcc compilers.
  37.  * 
  38.  * Revision 1.3  90/11/12  18:07:52  jkh
  39.  * Changed startup string to be more palatable to weird CPP's.
  40.  * 
  41.  * Revision 1.2  90/11/11  21:37:15  jkh
  42.  * Release 1.01.
  43.  * 
  44.  * Revision 1.1  90/11/06  22:52:39  jkh
  45.  * Initial revision.
  46.  * 
  47.  */
  48.  
  49. #include <X11/Intrinsic.h>
  50. #include <X11/StringDefs.h>
  51. #include <X11/Shell.h>
  52. #include <stdio.h>
  53. #include "Info.h"
  54.  
  55. static char info_msg[] = "\n\
  56. XInfo %2.2f, Copyright (C) 1990 Jordan K. Hubbard.\n\
  57. XInfo is free software and you are welcome to distribute copies of it\n\
  58. under certain conditions; you should have received a copy of these\n\
  59. conditions (see file 'COPYING') with this software. Type '?' for\n\
  60. a list of commands.\n\
  61. ";
  62.  
  63. int main(argc, argv)
  64. int argc;
  65. char **argv;
  66. {
  67.      Arg args[5];
  68.      Cardinal i;
  69.      Widget top;
  70.      static void quit();
  71.      static XtCallbackRec call[] = {
  72.       { quit, NULL },
  73.       { NULL, NULL },
  74.      };
  75.      static XrmOptionDescRec options[] = {
  76.       {"-node",    "*info.infoNode",    XrmoptionSepArg,    NULL},
  77.       {"-file",    "*info.infoFile",    XrmoptionSepArg,    NULL},
  78.       {"-path",    "*info.infoPath",    XrmoptionSepArg,    NULL},
  79.       {"-lpr",    "*info.printCommand",    XrmoptionSepArg,    NULL},
  80.      };
  81.  
  82.  
  83.      top = XtInitialize("xinfo", "XInfo", options, XtNumber(options),
  84.             &argc, argv);
  85.      i = 0;
  86.      XtSetArg(args[i], XtNcallback, call);        i++;
  87.      XtCreateManagedWidget("info", infoWidgetClass, top, args, i);
  88.  
  89.      XtRealizeWidget(top);
  90.  
  91.      /* Tell the user who we are */
  92.      fprintf(stderr, info_msg, XpInfoVersion);
  93.  
  94.      /* Spin until we get sick */
  95.      XtMainLoop();
  96.  
  97.      return(0); /* hope not, but lint likes this */
  98. }
  99.  
  100. static void quit(w, client_data, call_data)
  101. Widget w;
  102. caddr_t client_data, call_data;
  103. {
  104.      extern void exit();
  105.  
  106.      exit(0);
  107. }
  108.